import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    children:[
      {
        path: '/sys-admin/index',
        component: () => import('../views/sys-admin/temp/AdminIndexView.vue')
      },
      {
        path: '/sys-admin/temp/category/list',
        component: () => import('../views/sys-admin/temp/CategoryListView.vue')
      },
      {
        path: '/sys-admin/temp/attr/add-new',
        component: () => import('../views/sys-admin/temp/addAttr.vue')
      },
      {
        path: '/sys-admin/temp/attr/list',
        component: () => import('../views/sys-admin/temp/AttrList.vue')
      },
      {
        path: '/sys-admin/temp/admin/add-new',
        component: () => import('../views/sys-admin/temp/AdminAddNewView.vue')
      },
      {
        path:"/sys-admin/temp/brand/add-new",
        component:()=> import("../views/sys-admin/temp/addBrand.vue")
      },
      {
        path:"/sys-admin/temp/brand/list",
        component:()=> import("../views/sys-admin/temp/BrandList.vue")
      },
      {
        path:"/sys-admin/temp/album/add-new",
        component:()=> import("../views/sys-admin/temp/addAlbum.vue")
      },
      {
        path:"/sys-admin/temp/album/list",
        component:()=> import("../views/sys-admin/temp/AlbumList.vue")
      },
      {
        path:"/sys-admin/temp/admin/list",
        component:()=> import("../views/sys-admin/temp/AdminList.vue")
      },
      {
        path:"/sys-admin/temp/category/add-new",
        component:()=> import("../views/sys-admin/temp/addCategory.vue")
      },
      {
        path:"/sys-admin/temp/template/add-new",
        component:()=> import("../views/sys-admin/temp/addTemplate.vue")
      },
      {
        path:"/sys-admin/temp/template/list",
        component:()=> import("../views/sys-admin/temp/AttributeTemplate.vue")
      }
    ]
  },
  {
    path: '/about',
    name: 'about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  },
  {
    path:"/login",
    component:() => import("../views/LoginView.vue")
  },

  {
    path:"/brand",
    component:()=> import("../views/sys-admin/temp/addBrand.vue")
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
